/* 
 * File:   dialog.cpp
 * Author: jolo
 * 
 * Created on 5. Oktober 2011, 18:46
 */

#include "dialog.hpp"

#include <iostream>

namespace widgets
{

    dialog::dialog(QWidget* p)
    : QDialog(p),
            bbW_(0)
    {
    }

    dialog::~dialog()
    {
    }

    QDialogButtonBox* dialog::create_buttons() {
        bbW_ = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel,
                                    Qt::Horizontal,
                                    this);
        connect(bbW_, SIGNAL(rejected()), this, SLOT(reject()));
        connect(bbW_, SIGNAL(accepted()), this, SLOT(accept()));
        
        return bbW_;
    }
    
    void dialog::accept() {
        std::cerr << "reimplement void dialog::accept() in derived class!" << std::endl;
    }
    
    void dialog::reject() {
        std::cerr << "reimplement void dialog::reject() in derived class!" << std::endl;
    }
}